package com.example.myspringboot.consumer;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.messaging.handler.annotation.Payload;
import org.springframework.stereotype.Component;

/**
 * @author Chen Panrui
 * created at 2022/3/16 15:36
 */
@Component
public class MyMessageListener {

    @RabbitListener(queues = "queue.boot")
    public void onMessage(@Payload String message){
        System.out.println("接收到的消息:" + message);
    }

}
